using System.Text;
using Occupie.Enums;
using Mvc.Mailer;
using Occupie.Mailer;
using System.Collections.Generic;

namespace Occupie.Mailer
{
    public class UserMailer : MailerBase, IUserMailer
    {
        public UserMailer()
        {
            MasterName = "_Layout";
        }

        public virtual MvcMailMessage Message(MailModel model, EmailType type)
        {
            ViewData.Model = model;

            return Populate(x =>
            {
                x.BodyEncoding = Encoding.UTF8;
                x.IsBodyHtml = true;
                x.Subject = model.Subject;
                x.ViewName = type.ToString();
                x.To.Add(model.ReceiverEmail);
            });
        }

        public virtual MvcMailMessage EmployerPendingApproval(EmployerPendingApproval model)
        {
            //var resources = new Dictionary<string, string>();
            //resources["logo"] = CurrentHttpContext.Server.MapPath("~/Images/custom/logo.png");
            var mailMessage = new MvcMailMessage { Subject = model.Subject };

            mailMessage.To.Add(model.ReceiverEmail);

            ViewData.Model = model;
            PopulateBody(mailMessage, "EmployerPendingApproval");
            mailMessage.MasterName = "_LayoutAdmin";
            return mailMessage;
        }

        //internal virtual MvcMailMessage AdminNotificationMessage()
        //{
        //    ViewData.Model = model;

        //    return Populate(x =>
        //    {
        //        x.BodyEncoding = Encoding.UTF8;
        //        x.IsBodyHtml = true;
        //        x.Subject = model.Subject;
        //        x.ViewName = "AdminMessageModel";
        //        x.To.Add(model.ReceiverEmail);
        //    });
        //}
    }
}